package com.candy.control;

import com.candy.bean.UserInfo;
import com.candy.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
public class RegisterController {
    @Autowired
    RegisterService registerService;
    @RequestMapping("/register")
    public String register(UserInfo userInfo) {
        if(registerService.register(userInfo))return "ok";
        else return "no";
    }
}
